/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controladores;

import Entidades.Pais;
import Entidades.Transporte;
import java.util.List;
import logica.jpaControllers.PaisJpaController;
import logica.jpaControllers.TransporteJpaController;

/**
 *
 * @author USER
 */
public class CtrlTransporte {
     public CtrlTransporte() {
    }
    //guarda articulo
    public void guardarTransporte(Transporte art) {
        TransporteJpaController ga = new TransporteJpaController();
        ga.create(art);
    }
    
    public void eliminarTransporte(Transporte transporte) throws Exception{
        TransporteJpaController ga = new TransporteJpaController();
        ga.destroy(transporte.getIdTransporte());
    }

    public void modificarTransporte(Transporte a) throws Exception {
        TransporteJpaController ga = new TransporteJpaController();
        ga.edit(a);
    }
    
     
    public Transporte buscarTransporte_X_idTransporte(int idtransporte){
        TransporteJpaController ga = new TransporteJpaController();
        return ga.findTransporte(idtransporte);
       
    }
    
    public Transporte buscarTransportePatente(String pat) throws Exception{
        TransporteJpaController ga = new TransporteJpaController();
        return ga.findTransporte_x_patente(pat);
         
    }

//    public Pais buscarPaisMarca(String nom) throws Exception{
//        PaisJpaController ga = new PaisJpaController();
//        return ga.findArticulo_x_marca(nom);
//
//    }
        
    public List buscarTodosTransporte() throws Exception{
        TransporteJpaController ga = new TransporteJpaController();
        return ga.findTransporteEntities();
    }

//    public void guardarDemandasArticulos(DemandaArticulo da){
//        DemandaArticuloJpaController exp_da = new DemandaArticuloJpaController();
//        exp_da.create(da);
//    }
//    
//    public List buscarDemandas(Articulo art) {
//        ArticuloJpaController ga = new ArticuloJpaController();
//        return ga.findDemandas(art);
//         
//    }

}
